package management;

import java.io.Serializable;

/**
 * 课程实体类，包含课程编号、名称、学分
 */
public class Course implements Serializable {
    private String courseId;  // 课程编号（唯一标识）
    private String name;      // 课程名称
    private int credit;       // 学分

    public Course(String courseId, String name, int credit) {
        this.courseId = courseId;
        this.name = name;
        this.credit = credit;
    }

    // Getter方法
    public String getCourseId() { return courseId; }
    public String getName() { return name; }
    public int getCredit() { return credit; }

    // 重写toString：显示课程编号、名称、学分
    @Override
    public String toString() {
        return "[" + courseId + "] " + name + "（学分：" + credit + "）";
    }
}